#!/bin/bash

if [ ! $# -eq 5 ]
then
   echo "Usage: nodes deploy_dir username mosa_pack manager_port"
   exit 1
fi

nodes=$1
deploy_dir=$2
user=$3
mosa_pack=$4
manager_port=$5 #usually, 7005 FIXME We should `sed` the benefactor config

#echo DEPLOYING
#bash -x ./deploy.sh $user $nodes $mosa_pack $deploy_dir

echo RUNNING
manager_node=`head -n 1 ${nodes}`

tail -n 7 $nodes | ./start-all.sh $user $manager_node $manager_port ${deploy_dir}/mosa
